package com.szwistar.iot;

import java.util.ArrayList;
import java.util.List;


public final class CoModelInfo {
	Class<?> clazz;
    int typeId;
    String title;
    String catagory;
    String description;
	List<CoAttrInfo> fields = new ArrayList<CoAttrInfo>();

	public Class<?> getClazz() { return clazz; }
	public int getTypeId() { return typeId; }
	public String getTitle() { return title; }
	public String getCatagory() { return catagory; }
	public String getDescription() { return description; }
	public List<CoAttrInfo> getFields() { return fields; }

	protected CoModelInfo() {}

	// 从注解信息中生成
	protected CoModelInfo(Class<?> clazz, CoModelDef anno) {
		this.clazz = clazz;

	    typeId = anno.typeId();
		title = anno.title();
		catagory = anno.catagory();
		description = anno.description();
	}

	protected void putFieldInfo(CoAttrInfo fieldInfo) {
		fields.add(fieldInfo);
	}
}
